/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package models.beans;

import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 *
 * @author Group 3 Aprotrain Aptech  Group3 Aprotrain Aptech
 */
public class Admin extends org.apache.struts.action.ActionForm {
    
    private String adminId;
    private String adminName;
    private String password;
    private List<AdminBean> admin;

    public List<AdminBean> getAdmin() {
        return admin;
    }

    public void setAdmin(List<AdminBean> admin) {
        this.admin = admin;
    }
    

    public String getAdminId() {
        return adminId;
    }

    public void setAdminId(String adminId) {
        this.adminId = adminId;
    }

    public String getAdminName() {
        return adminName;
    }

    public void setAdminName(String adminName) {
        this.adminName = adminName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Admin() {
        super();
        this.adminId = "";
        this.adminName = "";
        this.password = "";
    }

    /**
     * This is the action called from the Struts framework.
     * @param mapping The ActionMapping used to select this instance.
     * @param request The HTTP Request we are processing.
     * @return
     */
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getAdminName() == null || getAdminName().length() < 1) {
            errors.add("name", new ActionMessage("error.adminName.required"));
            // TODO: add 'error.name.required' key to your resources
        }
        return errors;
    }
}
